<template>
  <el-form size="mini" class="f">
    <el-form-item label="票据号">{{transInfo.billNumber}}</el-form-item>
    <el-form-item label="承兑人">{{transInfo.acceptor}}</el-form-item>
    <div class="line-item">
      <el-form-item label="票面金额">{{transInfo.faceValue}}元</el-form-item>
      <el-form-item label="到期日">{{date}}</el-form-item>
    </div>
    <div class="line-item">
      <el-form-item label="每十万扣款">{{transInfo.billEveryDeduction}}元</el-form-item>
      <el-form-item label="贴息额">{{transInfo.discountAmount}}元</el-form-item>
      <el-form-item label="贴现额">{{transInfo.transferAmount}}元</el-form-item>
    </div>
    <slot></slot>
  </el-form>
</template>

<script lang="ts">
  import { Component, Prop, Vue } from 'vue-property-decorator'

  @Component
  export default class BillTransInfo extends Vue {
    @Prop() transInfo!
    agreement = true

    get date () {
      return this.$utils.toTimeFormat(+new Date(this.transInfo.expiryDate))
    }
  }
</script>
<style lang="less">
  .f {
    width: 80%;
    margin: 0 auto;
  }

  .o {
    text-align: center;
  }

  .line-item {
    > * {
      width: 33.3%;
      display: inline-block;
    }
  }
</style>
